#include<stdio.h>

int main()
{
    double cost, n;
    scanf("%lf",&n);
    if(n < 0)
    {
        printf("Invalid Value!");
    }
    else if(n <= 50)
    {
        cost = 0.53 * n;
        printf("cost = %.2f",cost);
    }
    else
    {
        cost = 0.53 * 50 + 0.58 * (n - 50);
        printf("cost = %.2f",cost);
    }

    return 0;
}